package day06;

public class Exercise {
    public static void main(String[] args) {
        say();

        sayHi("九亿少女的梦");

        sayHello("九亿少女的梦",25);

        double a=getNum();
        System.out.println(a);

        int b=plus(1,2);
        System.out.println(b);

        int[] c=testArray(10,100);
        for (int i=0;i<c.length;i++){
            System.out.println(c[i]);
        }


        int[] d=testArray(15,1000);
        int max=d[0];
        for (int i=1;i<d.length;i++){
            if (max<d[i]){
                max=d[i];
            }
            System.out.println(d[i]);
        }
        System.out.println("max="+max);



    }
    //方法
    public static void say(){
        System.out.println("大家好");
    }
    public static void sayHi(String name){
        System.out.println("我的名字是"+name);
    }
    public static void sayHello(String name,int age){
        System.out.println("我的名字是"+name+",我今年"+age+"岁了");
    }
    public static double getNum(){
        return(8.88);
    }
    public static int plus(int num1,int num2){
        int num=num1+num2;
        return(num);
    }
    public static int[] testArray(int len,int max){
        int[] arr=new int[len];
        for (int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
        return(arr);
    }


}
